<template>
	<view>
		<form @submit="formSubmit">
			<view class="login-wrapper" :style="colorStyle">
				<view class="login-top" style="padding: 20rpx;">当前位置：{{nowAddress}}</view>
				<view class="shading">
					<image :src="logoUrl" v-if="logoUrl" />
					<image :src="`${imgHost}logo-login.png`" v-else />
				</view>
				
				<view class="whiteBg" v-if="formItem === 2">
					<!-- 快速注册 -->
					<view class="list">
            <view class="item">
            	<view class="acea-row row-middle">
            		<image class="InvitationCode" :src="`${imgHost}contact.png`"></image>
            		<input type="text" placeholder="请输入姓名（必填）" v-model="real_name" maxlength="11" />
            	</view>
            </view>
						<view class="item on">
							<view class="acea-row row-middle">
								<image class="InvitationCode address" :src="`${imgHost}role.png`"></image>
								<view class="uni-list-cell-left" style="color: #808080;">
									请选择我的身份（必选）<text class="iconfont icon-xiangyou"></text>
								</view>
								<view class="uni-list-cell-db">
									<picker @change="bindPickerChange" :value="role" :range="array">
										<view class="uni-input">{{array[role]}}</view>
									</picker>
								</view>
							</view>
						</view>
            <view class="item on" v-if="isHouseType || isPart || isAlone || isMaker">
                <view class="acea-row row-middle">
                  <image class="InvitationCode address" :src="`${imgHost}role.png`"></image>
                  <view class="uni-list-cell-left" style="color: #808080;">
                    选择类别（必选）<text class="iconfont icon-xiangyou"></text>
                  </view>
                  <view class="uni-list-cell-db">
                    <view @click="openPopup">
                      <view class="uni-input">{{ selectedHouseTypes.length ? selectedHouseTypes.join(', ') : '请选择类别' }}</view>
                    </view>
                  </view>
                </view>
                <!-- 弹框 -->
                <uni-popup ref="popup" type="bottom">
                  <view class="popup-content">
                    <view class="popup-header">
                      <button @click="closePopup1">关闭</button>
                    </view>
                    <checkbox-group @change="houseTypeChange" :value="tempSelectedHouseTypes">
                      <view v-for="(type, index) in houseType" :key="index" :class="['checkbox-item', {'checked': tempSelectedHouseTypes.includes(type)}]">
                        <!-- 整行点击 -->
                        <label class="checkbox-label">
                          <checkbox :value="type" :checked="tempSelectedHouseTypes.includes(type)"></checkbox>
                          <view class="checkbox-text">{{ type }}</view>
                        </label>
                      </view>
                    </checkbox-group>
                    <button @click="confirmSelection">确定</button>
                  </view>
                </uni-popup>
              </view>
            <view class="item on" v-if="isHouseType || isPart || isAlone || isMaker" style="padding: 0;">
            	<view class="acea-row row-middle">
                <image class="InvitationCode" :src="`${imgHost}code_1.png`"></image>
                <input type="text" placeholder="请输入身份证号码（必填）" v-model="idCardNo" />
            	</view>
            </view>
            
            <view class="item on" v-if="isHouseType || isPart || isAlone || isMaker" style="padding: 0;">
            	<view class="input acea-row row-column">
                <view style="padding: 20rpx 0;display: flex;align-items: center;">
                  <image class="InvitationCode" :src="`${imgHost}code_1.png`"></image>
                  <view class='name' style="padding-left: 20rpx;color: #808080;">身份证正反面（选填）</view>
                </view>
            		<view class="input acea-row">
                  <view class="picEwm" v-if="idCardUrl.length" v-for="img,index in idCardUrl" :key="index">
                  	<image :src="img"></image>
                  	<text class='iconfont icon-guanbi1 fontcolor' @click='DelPicID(index)'></text>
                  </view>
            			<view v-if="idCardUrl.length < 2" class='pictrue acea-row row-center-wrapper row-column' @click="uploadpic('ID')" style="margin-right: 120rpx;" >
            				<text class='iconfont icon-icon25201'></text>
            				<view>上传图片</view>
            			</view>
            		</view>
            	</view>
            </view>
            <view class="item on" v-if="isHouseType || isAlone || isMaker" style="padding: 0;">
            	<view class="input acea-row row-column">
                <view style="padding: 20rpx 0;display: flex;align-items: center;">
                  <image class="InvitationCode" :src="`${imgHost}code_1.png`"></image>
                  <view class='name' style="padding-left: 20rpx;width: 100%;color: #808080;">身份证明截图：名片、朋友圈截图、钉钉信息截图、自媒体账号截图（不限于抖音、小红书等等社交平台）四选一即可（选填）</view>
                </view>
            		<view class="input acea-row">
                  <view class="picEwm" v-if="idTypeImg.length" v-for="img,index in idTypeImg" :key="index">
                  	<image :src="img"></image>
                  	<text class='iconfont icon-guanbi1 fontcolor' @click='DelPicIMG(index)'></text>
                  </view>
            			<view  class='pictrue acea-row row-center-wrapper row-column' @click="uploadpic('IMG')" style="margin-right: 120rpx;" >
            				<text class='iconfont icon-icon25201'></text>
            				<view>上传图片</view>
            			</view>
            		</view>
            	</view>
            </view>
						<view class="item on" v-if="isIdeal" style="padding: 0;">
							<view class="acea-row row-middle">
                <image class="InvitationCode" :src="`${imgHost}contact.png`"></image>
                <input type="text" placeholder="请输入项目名称(多个项目用' , '隔开 ;选填)" v-model="project_name" maxlength="11" />
							</view>
						</view>
						
						<view class="item" v-if="isIdeal">
							<view class="acea-row row-middle">
								<image class="InvitationCode" :src="`${imgHost}area.png`"></image>
								<input type="text" placeholder="请输入房号（选填）" v-model="room" />
							</view>
						</view>
						
						<view class="item" v-if="isIdeal">
							<view class="acea-row row-middle">
								<image class="InvitationCode" :src="`${imgHost}area.png`"></image>
								<input type="text" placeholder="请输入总面积/m²（选填）" v-model="acreage" />
							</view>
						</view>
						
						<view class="item on" v-if="isArea">
							<view class="acea-row row-middle">
								<image class="InvitationCode address" :src="`${imgHost}role.png`"></image>
								<view class="uni-list-cell-left" style="color: #808080;">
									选择想要（必选）<text class="iconfont icon-xiangyou"></text>
								</view>
								<view class="uni-list-cell-db">
									<picker @change="wantToChange" :value="wantToIndex" :range="wantTo">
										<view class="uni-input">{{wantTo[wantToIndex]}}</view>
									</picker>
								</view>
							</view>
						</view>
						<view class="item" v-for="(item, index) of addressList" :key="index" v-if="isArea">
							<view class="acea-row row-center-wrapper">
								<image class="InvitationCode address" :src="`${imgHost}city.png`"></image>
								<input type="text" placeholder="自定义区域（选填）" v-model="item.name" @input="setValue" @tap="inputConfirm(item)" />
								<view class="seting acea-row row-center-wrapper" style="padding: 0;">
									<view class="iconfont icon-jiahao" style="margin-right: 20rpx;" @click="add(index)"></view>
									<view class="iconfont icon-jianhao" @click="del(index)"></view>
								</view>
							</view>
						</view>
						<view class='item on'>
							<!-- <view class="acea-row row-middle">
								<image class="InvitationCode" :src="`${imgHost}city.png`"></image>
								<view class="addressCon acea-row" @click="changeRegion">
									<text class="picker color-add" v-if="!addressInfo.length">请选择所在区域（必选）</text>
									<view v-else>
										<text class="picker">{{addressText}}</text>
									</view>
								</view>
							</view> -->
              <view class="acea-row row-middle">
              	<image class="InvitationCode address" :src="`${imgHost}city.png`"></image>
              	<view class="uni-list-cell-left" style="color: #808080;">
              		请选择所在区域（必选）<text class="iconfont icon-xiangyou"></text>
              	</view>
              	<view class="uni-list-cell-db">
              		<picker @change="changeRegion" :value="addressIndex" :range="addressInfo">
              			<view class="uni-input">{{addressInfo[addressIndex]}}</view>
              		</picker>
              	</view>
              </view>
						</view>
						<view class='item'>
							<view class="acea-row row-middle">
								<image class="InvitationCode" :src="`${imgHost}address-book.png`"></image>
								<input type='text' placeholder='请填写具体地址（必填）' v-model='addres'></input>
							</view>
						</view>		
            
            <!-- <view class="item">
            	<view class="acea-row row-middle">
            		<image class="itemImg-add" :src="`${imgHost}phone_1.png`"></image>
            		<input type="text" placeholder="注册手机号码" v-model="account" maxlength="11" />
            	</view>
            </view>
            <view class="item">
            	<view class="acea-row row-middle">
            		<image class="item-img" :src="`${imgHost}code_2.png`"></image>
            		<input type="text" placeholder="手机验证码" maxlength="6" class="codeIput" v-model="captcha" />
            		<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">
            			{{ text }}
            		</button>
            	</view>
            </view> -->
            <view style="margin-top: 20rpx; text">*确保所填信息为真实有效信息，如经审核信息无效，平台有权收回账号</view>
            <view style="margin-top: 20rpx; text">温馨提示:因目前平台主要在城区的南城、东城、莞城、万江街道开放，东莞市其他区域暂时尚待开发中，业务人员将会与您保持联系。</view>
						<view class="user-info" v-if="isVerify">
							<view class="user-info-top acea-row row-center-wrapper">
								<view class="top-image">
									<image class="InvitationCode" :src="recommended.avatar"></image>
								</view>
								<view class="top-nickname">
									{{nameShow(recommended.nickname)}}<text>{{phoneNumShow(recommended.phone)}}</text>
								</view>
							</view>
							<view class="user-info-down">
								邀请您加入{{site_name}}
							</view>
						</view>
					</view>
					<!-- 注册按钮 -->
					<view class="logon" @click="register()">注册</view>
          <view class="contract"  v-if="isHouseType || isPart || isAlone || isMaker" >
          	<checkbox-group @change="ChangeIsContract">
          		<checkbox :class="inAnimation ?'trembling':''" @animationend='inAnimation=false'  :checked="contract" />
          		已阅读并同意<text class="main-color" @click="showDialog = true">《平台合同》</text>（注册即签署）
          	</checkbox-group>
          </view>
					<view class="protocol">
						<checkbox-group @change='ChangeIsDefault'>
							<checkbox :class="inAnimation?'trembling':''" @animationend='inAnimation=false' :checked="protocol ? true : false" />
							已阅读并同意<text class="main-color" @click="privacy('user')">《用户协议》</text>
							与<text class="main-color" @click="privacy('privacy')">《隐私协议》</text>
						</checkbox-group>
					</view>
				</view>
			</view>
		</form>
    <!-- <vcode :show="isShow" @success="onSuccess()" @close="onClose()" successText="行为验证通过" /> -->
		<canvas canvas-id="canvas" v-if="canvasStatus" :style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
		<areaWindow ref="areaWindow" :display="display" :address="addressInfo" @submit="OnChangeAddress" @changeClose="changeClose"></areaWindow>
		<applyWindow :change="change" :dataer="h5Data" v-on:closeChange="closeChange($event)" v-on:saveApply="saveApply"></applyWindow>
    <registerContract :showDialog.sync="showDialog" @agree="agree" @closePopup='closePopup' :contract="contract" />
		<home v-if="navigation"></home>
	</view>
</template>

<script>
  const app = getApp();
  import { postRequest } from '../../../api/registerr';
	import {
		getUserInfo,
		userEdit,
		getLogout,
		getGeocoder,
		getCityList,
		applySaveApi,
		recommendedByApi,
    getCodeApi,
    registerVerify,
	} from '@/api/user.js';
	import {
    phoneLogin,
		switchH5Login,
		getCity,
		getIndexData
	} from '@/api/api.js';
  import {
  	getLogo
  } from "@/api/public";
	import {
		toLogin
	} from '@/libs/login.js';
	import {
		mapGetters
	} from "vuex";
	import {
	  HTTP_REQUEST_URL
	} from '@/config/app';
	import dayjs from "@/plugin/dayjs/dayjs.min.js";
	import colors from '@/mixins/color.js';
	import areaWindow from '@/components/areaWindow';
  import sendVerifyCode from "@/mixins/SendVerifyCode";
  import Vcode from "vue-puzzle-vcode";
	import home from '@/components/home';
	import applyWindow from '@/components/applyWindow';
  import { JSONToGet } from '@/utils/jsonp.js'
  import registerContract from '@/components/registerContractv/index.vue'
	export default {
		components: {
      Vcode,
			home,
			areaWindow,
			applyWindow,
      registerContract
		},
		mixins: [sendVerifyCode, colors],
		data() {
			return {
        isStaff:false,
        idCardUrl:[],
        inAnimation: false,
        showDialog: false,
        protocol: false,
        contract:false,
        isShow: false,
        site_name: '',
        captcha: '',
        account: "",
        password:'123456tx',
        formItem: 2,
        logoUrl: "",
				userInfo: {},
				loginType: 'h5', //app.globalData.loginType
				userIndex: 0,
				switchUserInfo: [],
				isAuto: false, //没有授权的不会自动授权
				isShowAuth: false, //是否隐藏授权
				canvasWidth: "",
				canvasHeight: "",
				canvasStatus: false,
				district: [],
				multiArray: [],
				multiIndex: [0, 0, 0],
				valueRegion: [0, 0, 0],
				region: ['省', '市', '区'],
				mp_is_new: this.$Cache.get('MP_VERSION_ISNEW') || false,
        district_id:'',
				
				isStreet:0,
				display: false,
				addressInfo:['城区片区','松山湖片区','滨海片区','水乡新城片区','东部产业园片区','东南临深片区'],
        addressIndex:0,
				
				imgHost: `${HTTP_REQUEST_URL}/statics/images/`,
				role: 0,
				array: [ '租房','房东','兼职经纪人','专职经纪人','独立经纪人(普通合伙人)'], // ,'创客经纪人合作'
				
				isHouseType: false,
				houseType: ['写字楼','厂房','仓库','商铺','公寓','住宅','土地'],
				houseTypeIndex: 0,
        selectedHouseTypes: [] ,// 用于存储选中的类型
        tempSelectedHouseTypes: [] ,// 用于暂存弹框中的选择
				
				isIdeal: true,
				wantTo: ['写字楼','厂房','商铺','公寓'],
				wantToIndex: 0,
				
				isArea: false,
				room: '',
				acreage: '',
				real_name: '',
				addres: '',
        
        isPart:'',
        isAlone:'',
        isMaker:'',
				
				project_name: '',
				
				change: false,
				apply_sum: 0,
				h5Data:{},
				addressList: [{
					name: ''
				}],
				
				recommended: {},
				invitationCode: 1,
				isVerify: false,
        
        nowAddress: '',
        idCardNo:'',
        idTypeImg:[]
			};
		},
		computed: {...mapGetters(['isLogin']),
			addressText(){
				return this.addressInfo.map(v=>v.label).join('/');
			},
			isSend() {
				if (this.invitationCode == 0) {
					this.isVerify = false;
					return false;
				} else {
					return true;
				}
			}
		},
		watch: {
			isLogin: {
				handler: function(newV, oldV) {
					if (newV) {
						this.getUserInfo();
					}
				},
				deep: true
			},
			addressInfo(val) {
				this.isStreet = val.length < 3 ? 0 : 1;
			}
		},
		onLoad(options) {
			let that = this;
      if(options.spid){
        that.spread = options.spid ? options.spid : app.globalData.spid || 0;
        uni.setStorageSync('spid',that.spread);
        if (that.isLogin) {
        	that.recommendedBy(uni.getStorageSync('spid'));
        } else {
        	toLogin();
        }
        that.getUserInfo();
        that.sendText()
        that.getLocation()
      }else{
        this.isStaff = true
      }
		},
		onShow() {
			if (!this.isLogin) {
				toLogin();
			}
			uni.removeStorageSync('form_type_cart');
		},
		mounted: function() {
			this.getIndexData();
      this.getLogoImage();
		},
		methods: {
      ChangeIsContract(){
        if (this.contract) {
          return
        }
        this.showDialog = true;
      },
      // 获取短信验证码
      code() {
      	let that = this;
      	if (!that.account) return that.$util.Tips({
      		title: '请填写手机号码'
      	});
      	if (!that.protocol) {
      		this.inAnimation = true;
      		return that.$util.Tips({
      			title: '请先阅读并同意协议'
      		});
      	}
      	if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
      		title: '请输入正确的手机号码'
      	});
      	this.isShow = true;
      },
      // 滑动验证块成功
      onSuccess() {
      	let that = this;
      	getCodeApi().then(res => {
      		console.log('获取验证码',res)
      		that.keyCode = res.data.key;
      		that.getCode();
      	}).catch(res => {
      		that.$util.Tips({
      			title: res
      		});
      	});
      	this.isShow = false; // 通过验证后
      },
      // 用户点击遮罩层，应该关闭模态框
      onClose() {
          this.isShow = false;
      },
      // 发送验证码
      async getCode() {
      	let that = this;
      	if (!that.account) return that.$util.Tips({
      		title: '请填写手机号码'
      	});
      	if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
      		title: '请输入正确的手机号码'
      	});
      	if (that.formItem == 2) that.type = "register";
      	console.log('>>>>>>>',that.keyCode)
      	await registerVerify({
      		phone: that.account,
      		type: that.type,
      		key: that.keyCode,
      		code: that.codeVal
      	}).then(res => {
      		console.log('获取验证码',res)
      		that.$util.Tips({
      			title: '发送成功'
      		});
      		that.sendCode();
      	}).catch(res => {
      		console.log('获取验证码失败',res)
      		that.$util.Tips({
      			title: res
      		});
      	});
      },
      // 是否勾选协议
      ChangeIsDefault(e) {
      	this.$set(this, 'protocol', !this.protocol);
      },
      DelPicIMG(index) {
      	this.idTypeImg.splice(index, 1);
      },
      DelPicID(index) {
      	this.idCardUrl.splice(index, 1);
      },
      uploadpic(type) {
        let that = this
      	that.$util.uploadImageOne('upload/image', function(res) {
          if(type=='ID'){
            that.idCardUrl.push(res.data.url)
          }else{
            that.idTypeImg.push(res.data.url)
          }
      	});
      },
      closePopup(){
        this.showDialog = false
      },
      agree(){
        uni.showToast({
          title: '您已同意合同条款',
          icon: 'success',
          duration: 1000
        })
        this.contract = true
        this.protocol = true
        this.showDialog = false
      },
      isMinor(idCard) {
        const regex = /^\d{17}(\d|X|x)$/;
        if (!regex.test(idCard)) return false;
        const birthDate = idCard.substring(6, 14); // YYYYMMDD
        const year = parseInt(birthDate.substring(0, 4), 10);
        const month = parseInt(birthDate.substring(4, 6), 10);
        const day = parseInt(birthDate.substring(6, 8), 10);
        const now = new Date();
        const currentYear = now.getFullYear();
        const currentMonth = now.getMonth() + 1; // 月份从0开始
        const currentDay = now.getDate();
        if (currentYear - year > 18) {
          return false;
        } else if (currentYear - year == 18) {
          if (currentMonth < month || (currentMonth == month && currentDay < day)) {
            return true; 
          }
        }
        return true;
      },
      register(){
        let that = this,
        value = {}
        
        if(that.nowAddress !== '东莞市'){
          uni.showToast({
            title: '您当前所在地区不在活动范围内，无法参加此活动',
            icon: 'none',
            duration: 3000,
          })
          return
        }
        if(!that.real_name){
          uni.showToast({
            title: '请输入姓名',
            icon: 'none',
            duration: 3000,
            })
            return
        }
        const nameRegex = /^[\u4e00-\u9fa5]{2,20}$/;
        if (!nameRegex.test(that.real_name)) {
          uni.showToast({
            title: '姓名格式不正确',
            icon: 'none',
            duration: 3000,
          });
          return;
        }
        if(that.isHouseType || that.isPart || that.isAlone || that.isMaker){
          if(!that.selectedHouseTypes.length){
            uni.showToast({
              title: '请选择类别',
              icon: 'none',
              duration: 3000,
              })
              return
          }
          if (!that.idCardNo) {
            uni.showToast({
              title: '请输入身份证号',
              icon: 'none',
              duration: 3000,
            });
            return;
          }
          const idCardRegex = /^\d{17}(\d|X|x)$/;
          if (!idCardRegex.test(that.idCardNo)) {
            uni.showToast({
              title: '身份证号格式不正确',
              icon: 'none',
              duration: 3000,
            });
            return; // 校验身份证是否为18位
          }
          if (that.isMinor(that.idCardNo)) {
            uni.showToast({
              title: '未成年用户无法注册',
              icon: 'none',
              duration: 3000,
            });
            return; // 检查是否为未成年人
          }
          if(!that.contract){
            uni.showToast({
              title: '请先阅读平台合同',
              icon: 'none',
              duration: 3000,
              })
              return
          }
        }
        // if(!that.account){
        //   uni.showToast({
        //     title: '请输入手机号',
        //     icon: 'none',
        //     duration: 3000,
        //     })
        //     return
        // }
        // // 校验手机号是否为11位
        // const phoneRegex = /^1[3-9]\d{9}$/;
        // if (!phoneRegex.test(that.account)) {
        //   uni.showToast({
        //     title: '手机号格式不正确',
        //     icon: 'none',
        //     duration: 3000,
        //     })
        //     return;
        // }
        // if(!that.captcha){
        //   uni.showToast({
        //     title: '请输入验证码',
        //     icon: 'none',
        //     duration: 3000,
        //     })
        //     return
        // }
        if(!that.addres){
          uni.showToast({
            title: '请填写具体地址',
            icon: 'none',
            duration: 3000,
          })
          return
        }
        if(!that.protocol){
          uni.showToast({
            title: '请先勾选用户协议和隐私协议',
            icon: 'none',
            duration: 3000,
          })
          return
        }
        // if(that.isHouseType || that.isAlone || that.isMaker){
        //   if(that.idCardUrl.length<2){
        //     uni.showToast({
        //       title: '请上传完整的身份证正反面照片',
        //       icon: 'none',
        //       duration: 3000,
        //       })
        //       return
        //   }
        // if(that.idTypeImg.length){
        //   uni.showToast({
        //     title: '请上传至少一张身份证明图片',
        //     icon: 'none',
        //     duration: 3000,
        //     })
        //     return
        //   }
        // }
        let params = {
          // mobile:that.account,// 手机号
          type:1,// 类型 1个人 2企业
          // cooperation_type:'',// 合作类型
          realname:that.real_name,// 姓名
          idtype:1,// 身份证类型
          idno:that.idCardNo,// 身份证号
          // identity_type:'',// 身份类型
          // main_business:'',// 主营业务
          province:'440000000000',// 省份
          city:'441900000000',// 城市
          // district:'',// 区
          desc:''
        }
        if(that.isPart){
          params.cooperation_type = 10
          params.identity_type = 60
        }
        if(that.isHouseType){
          params.cooperation_type = 20
          params.identity_type = 10
        }
        if(that.isAlone){
          params.cooperation_type = 60
          params.identity_type = 10
        }
        if(that.isMaker){
          params.cooperation_type = 70
          params.identity_type = 10
        }
        const houseTypeMapping = {
            10: "写字楼",
            20: "厂房",
            30: "仓库",
            40: "商铺",
            50: "公寓",
            60: "住宅",
            70: "土地"
        };
        params.main_business= that.selectedHouseTypes.map(type => {
          // 在houseTypeMapping中查找对应的键
        const entry = Object.entries(houseTypeMapping).find(([key, value]) => value === type);
          return entry ? Number(entry[0]) : null; // 返回对应的数字（键）
        }).join(',')
        const addressMapping = {
          441910000000: '城区片区',
          441920000000: '松山湖片区',
          441930000000: '滨海片区',
          441940000000: '水乡新城片区',
          441950000000: '东部产业园片区',
          441960000000: '东南临深片区',
        }
        const addressValue = Object.values(addressMapping)[that.addressIndex];
        const districtKey = Object.keys(addressMapping).find(key => addressMapping[key] === addressValue);
        params.district = districtKey ? Number(districtKey) : null;
        
        that.district_id = params.district
        value.real_name = that.real_name
        value.spread = that.spread
        value.role = that.role
        value.address = {
          province:'广东省',// 省份
          city:'东莞市',// 城市
          district: addressValue,// 区
        },
        value.address_detail = that.addres
        // return 
        userEdit(value).then(res => {
          console.log('res',res);
          if(that.isHouseType || that.isPart || that.isAlone || that.isMaker){
            // 有效的推荐人id
            postRequest('/api/fission/getRecommend',{district:params.district,recommend_id:that.recommended.mini_uid,recommend_mobile:that.recommended.phone}, function(err1,res1){
              if(err1){
                uni.showToast({
                  title: '网络错误，请稍后重试',
                  icon: 'none',
                  duration: 2000,
                })
              }else{
              let resOne = JSON.parse(res1)
              console.log('res111',resOne);
                if(resOne.code == 1){
                  params.mobile = res.data.phone.phone
                  params.recommend = that.recommended.mini_uid
                  params.recommend_id = resOne.data
                  postRequest('/api/fission/splitRegister',params, function(err2,res2){
                    if(err2){
                      uni.showToast({
                        title: '网络错误，请稍后重试',
                        icon: 'none',
                        duration: 2000,
                      })
                    }else{
                      let resTwo = JSON.parse(res2)
                      console.log('res222',resTwo);
                      if (resTwo.code == 1) {
                        uni.showToast({
                          title: '登录中',
                          icon: 'loading',
                          duration: 2000
                        })
                        setTimeout(() => {
                          uni.switchTab({
                            url: '/pages/user/index'
                          })
                        }, 2000)
                      } else {
                        // 根据返回的 code 做不同处理
                        uni.showToast({
                          title: resTwo.msg || '请求失败2',
                          icon: 'none',
                          duration: 2000
                        })
                      }
                    }
                  });
                }else{
                  uni.showToast({
                    title: res1.msg || '请求失败1',
                    icon: 'none',
                    duration: 2000
                  })
                }
              }
            })
          }else{
            uni.showToast({
              title: '登录中',
              icon: 'loading',
              duration: 2000
            })
            setTimeout(() => {
              uni.switchTab({
                url: '/pages/user/index'
              })
            },2000)
          }
        }).catch(res => {
        	console.log('>>>>>>>>>>提交注册失败',res)
        	that.$util.Tips({
        		title: res
        	});
        });
      },
      privacy(type) {
      	uni.navigateTo({
      		url: "/pages/users/privacy/index?type=" + type
      	})
      },
      getLocation() {
        let that = this
        that.nowAddress = '定位中...'
        uni.getLocation({
          type: 'wgs84',
          altitude: true,
          success: (res) => {
            that.getLocationInfo(res.latitude, res.longitude)
          },
          fail: (err) => {
            console.log(err)
            uni.showModal({
              title: '检测到您没打开获取信息功能权限，是否去设置打开',
              content: '无法正常获取地区数据',
              success: (res2) => {
                if (res2.confirm) {
                  uni.openSetting({
                    success(res3) {
                      if (res3.authSetting['scope.userLocation']) {
                        that.getLocation()
                      } else {
                        that._getRegion()
                      }
                    }
                  })
                } else {
                  console.log('+++++++++')
                }
              }
            })
          }
        })
      },
      //逆坐标解析
      getLocationInfo(latitude, longitude) {
        console.log('message')
        JSONToGet(`https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&get_poi=1`).then((res) => {
          console.log('//////////', res)
          if (res.status == 0) {
            this.nowAddress = res.result.ad_info.city
          } else {
            uni.showToast({
              title: res.message,
              duration: 3000,
              icon: 'none'
            })
          }
        })
      },
      // 登录注册切换
      formItemTab: function(e){
      	this.formItem = e;
      },
      // 请求logo数据
      async getLogoImage() {
      	let that = this;
      	getLogo(2).then(res => {
      		that.logoUrl = res.data.logo_url;
      	});
      },
			/**
			 * 获取用户详情
			 */
			getUserInfo: function() {
				let that = this;
				getUserInfo().then(res => {
					let userInfo = res.data;
					console.log('个人信息>>>>>>>',userInfo)
					that.role = Number(userInfo.role);
					switch(that.role){
					case 0:
						this.isIdeal = false ;
						this.isArea = true;
						this.isHouseType = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = false
						break;
					case 1:
						this.isArea = false;
						this.isHouseType = true;
						this.isIdeal = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = false
						break;
					case 2:
						this.isHouseType = false;
						this.isIdeal = false;
						this.isArea = false;
            this.isPart = true
            this.isAlone = false
            this.isMaker = false
						break;
					case 3:
            this.isArea = false;
            this.isHouseType = true;
            this.isIdeal = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = false
						break;
          case 4:
            this.isArea = false;
            this.isHouseType = false;
            this.isIdeal = false;
            this.isPart = false
            this.isAlone = true
            this.isMaker = false
            break;
          case 5:
            this.isArea = false;
            this.isHouseType = false;
            this.isIdeal = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = true
            break;
					}
					that.$set(that, 'userInfo', userInfo);
				}).catch(res => {
					toLogin();
					console.log('>>>',res)
				});
				
				let spid = uni.getStorageSync('spid');
				that.invitationCode = spid ? spid : that.userInfo.spread_uid ? that.userInfo.spread_uid : 0;
			},
			// 发送消息
			sendText() {
				if (!this.isSend || this.invitationCode === 0) {
					return 
				}
				this.recommendedBy(this.invitationCode);
			},
			recommendedBy(e) {
				let that = this;
				console.log('>>>>>>>验证推荐人',e)
				recommendedByApi({
					spread_spid: e
				}).then(res => {
					console.log('>>>>>>>验证推荐人',res.data)
					that.recommended = res.data;
					this.isVerify = true;
				}).catch(res => {
					console.log('>>>>>>>验证推荐人',res)
				});
			},
			phoneNumShow(phone) {
				let that = this;
				return phone.substring(0, 3) + '****' + phone.substring(7);
			},
			
			nameShow(name) {
				let that = this;
				return name.substring(0, 1) + '*' + name.substring(2);
			},
			getIndexData() {
				let that = this;
				getIndexData().then(res => {
					console.log('>>>>>>>',res)
					that.site_name = res.data.site_name;
					that.projectList = res.data.projectList;
				});
			},
			inputConfirm: function(event) {
				let that = this;
				that.ids = event.id;
			},
			setValue: function(event) {
				let that = this;
			},
			add(e){
				let that = this;
				let data = {
					id:that.addressList.length,
					name:''
				}
				that.addressList.splice((Number(e)+1),0,data);
			},
			del(e){
				let that = this;
				that.addressList.splice(e,1);
			},
			addApply: function() {
				this.change = true;
			},
			saveApply: function(opt) {
				let that = this,
					data = {},
					name = opt.name;
				
				if (!name) {
					return that.$util.Tips({
						title: '请输入项目名称'
					});
				}
				applySaveApi(opt).then(res => {
					console.log('>>>>>>>>>>>>>>>>>',res)
					that.change = false;
					that.projectList = res.data;
					that.$util.Tips({
						title: '创建成功',
						icon: 'success'
					})
				}).catch(msg => {
					console.log('>>>>',msg)
					that.change = false;
					that.$util.Tips({
						title: '创建失败',
						icon: 'none'
					})
				});
			},
			closeChange: function(msg) {
				this.change = msg;
			},
			wantToChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.wantToIndex = e.detail.value;
			},
			projectChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.projectIndex = e.detail.value;
			},
			 // 打开弹框
    openPopup() {
      this.tempSelectedHouseTypes = [...this.selectedHouseTypes]; // 暂存当前选择的内容
      this.$refs.popup.open(); // 打开弹框
    },
    // 关闭弹框
    closePopup1() {
      this.$refs.popup.close(); // 关闭弹框
    },
    // 处理选中的多选框内容
    houseTypeChange(e) {
      this.tempSelectedHouseTypes = e.detail.value;
    },
    // 确认选择并关闭弹框
    confirmSelection() {
      this.selectedHouseTypes = [...this.tempSelectedHouseTypes]; // 更新选中的内容
      this.closePopup1(); // 关闭弹框
    },
      changeRegion: function(e) {
      	console.log('picker发送选择改变，携带值为', e.detail.value)
      	this.addressIndex = e.detail.value;
      },
			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.role = e.detail.value;
				switch(e.detail.value){
					case 0:
						this.isIdeal = true;
						this.isArea = false;
						this.isHouseType = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = false
            this.contract ? false : true
						break;
					case 1:
						this.isArea = true;
						this.isHouseType = false;
						this.isIdeal = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = false
            this.contract = false
						break;
					case 2:
						this.isHouseType = false;
						this.isIdeal = false;
						this.isArea = false;
            this.isPart = true
            this.isAlone = false
            this.isMaker = false
            this.showDialog = this.contract ? false : true
						break;
					case 3:
            this.isArea = false;
            this.isHouseType = true;
            this.isIdeal = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = false
            this.showDialog = this.contract ? false : true
						break;
          case 4:
            this.isArea = false;
            this.isHouseType = false;
            this.isIdeal = false;
            this.isPart = false
            this.isAlone = true
            this.isMaker = false
            this.showDialog = this.contract ? false : true
            break;
          case 5:
            this.isArea = false;
            this.isHouseType = false;
            this.isIdeal = false;
            this.isPart = false
            this.isAlone = false
            this.isMaker = true
            this.showDialog = this.contract ? false : true
            break;
				}
			},
			
			// 获取选中位置
			chooseLocation: function() {
				let self = this;
				uni.chooseLocation({
					success: (res) => {
						let latitude, longitude;
						latitude = res.latitude.toString();
						longitude = res.longitude.toString();
						this.latitude = res.latitude
						this.longitude = res.longitude
						getGeocoder({
							lat: latitude,
							long: longitude
						}).then(res => {
							const data = res.data;
							getCityList(data.address_component.province+'/'+data.address_component.city+'/'+data.address_component.district+'/'+(!data.address_reference.town ? '' : data.address_reference.town.title)).then(res=>{
								console.log('>>>>>>>>>>>>',res)
								self.addressInfo = res.data;
								self.userAddress.detail = data.formatted_addresses.recommend;
							}).catch(err => {
								self.$util.Tips({
									title: err
								});
							});
						})
					},
					fail: (err)=>{
						console.log(err)
					}
				})
			},
			// changeRegion(){
			// 	this.display = true;
			// },
			OnChangeAddress(address){
				this.latitude = ''
				this.longitude = ''
				this.isStreet = 0
				this.addressInfo = address;
				console.log('地址>>>>',this.addressInfo)
			},
			// 关闭地址弹窗；
			changeClose: function() {
				this.display = false;
			},
			// 省市区地址处理逻辑
			goAddressList(){
				this.getCityList();
			},
			// 获取地址数据
			getCityList() {
				let that = this;
				getCity().then(res => {
					this.district = res.data
					that.initialize();
				})
			},
			// 处理地址数据
			initialize: function() {
				let that = this,
					province = [],
					city = [],
					area = [];
				if (that.district.length) {
					let cityChildren = that.district[0].c || [];
					let areaChildren = cityChildren.length ? (cityChildren[0].c || []) : [];
					that.district.forEach(function(item) {
						province.push(item.n);
					});
					cityChildren.forEach(function(item) {
						city.push(item.n);
					});
					areaChildren.forEach(function(item) {
						area.push(item.n);
					});
					this.multiArray = [province, city, area]
				}
			},
			bindRegionChange(e,index) {
				let multiIndex = this.multiIndex,
					province = this.district[multiIndex[0]] || {
						c: []
					},
					city = province.c[multiIndex[1]] || {
						v: 0
					},
					multiArray = this.multiArray,
					value = e.detail.value;
			
				this.region = [multiArray[0][value[0]], multiArray[1][value[1]], multiArray[2][value[2]]]
				this.userInfo.register_extend_info[index].value = city.v;
				this.userInfo.register_extend_info[index].province = this.region[0];
				this.userInfo.register_extend_info[index].city = this.region[1];
				this.userInfo.register_extend_info[index].district = this.region[2];
				this.valueRegion = [0, 0, 0]
				this.initialize();
			},
			bindMultiPickerColumnChange(e) {
				let that = this,
					column = e.detail.column,
					value = e.detail.value,
					currentCity = this.district[value] || {
						c: []
					},
					multiArray = that.multiArray,
					multiIndex = that.multiIndex;
				multiIndex[column] = value;
				switch (column) {
					case 0:
						let areaList = currentCity.c[0] || {
							c: []
						};
						multiArray[1] = currentCity.c.map((item) => {
							return item.n;
						});
						multiArray[2] = areaList.c.map((item) => {
							return item.n;
						});
						break;
					case 1:
						let cityList = that.district[multiIndex[0]].c[multiIndex[1]].c || [];
						multiArray[2] = cityList.map((item) => {
							return item.n;
						});
						break;
					case 2:
						break;
				}
				// #ifdef MP || APP-PLUS
				this.$set(this.multiArray, 0, multiArray[0]);
				this.$set(this.multiArray, 1, multiArray[1]);
				this.$set(this.multiArray, 2, multiArray[2]);
				// #endif
				// #ifdef H5 
				this.multiArray = multiArray;
				// #endif
				this.multiIndex = multiIndex
			},
			radioChange(e, index){
				this.userInfo.register_extend_info[index].value = e.detail.value
			},
			bindDateChange: function(e, index) {
				this.userInfo.register_extend_info[index].value = e.target.value
			},
			/**
			 * 小程序设置
			 */
			Setting: function() {
				uni.openSetting({
					success: function(res) {}
				});
			},
			switchAccounts: function(index) {
				let userInfo = this.switchUserInfo[index],
					that = this;
				that.userIndex = index;
				if (that.switchUserInfo.length <= 1) return true;
				if (userInfo === undefined) return that.$util.Tips({
					title: '切换的账号不存在'
				});
				if (userInfo.user_type === 'h5') {
					uni.showLoading({
						title: '正在切换中'
					});
					switchH5Login().then(res => {
						uni.hideLoading();
						that.$store.commit("LOGIN", {
							'token': res.data.token,
							'time': this.$Cache.strTotime(res.data.expires_time) - this.$Cache.time()
						});
						that.getUserInfo();

					}).catch(err => {
						uni.hideLoading();
						return that.$util.Tips({
							title: err
						});
					})
				} else {
					that.$store.commit("LOGOUT");
					uni.showLoading({
						title: '正在切换中'
					});
					toLogin();
				}
			},
			/**
			 * 退出登录
			 * 
			 */
			outLogin: function() {
				let that = this;
				if (that.loginType == 'h5') {
					uni.showModal({
						title: '提示',
						content: '确认退出登录?',
						success: function(res) {
							if (res.confirm) {
								getLogout().then(res => {
									that.$store.commit("LOGOUT");
									uni.reLaunch({
										url: '/pages/index/index'
									})
								}).catch(err => {});
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				}
			},
			/**
			 * 上传文件
			 */
			// uploadpic: function() {
			// 	let that = this;
			// 	this.canvasStatus = true
			// 	that.$util.uploadImageChange('upload/image', (res) => {
			// 		let userInfo = that.switchUserInfo[that.userIndex];
			// 		// if (userInfo !== undefined) {
			// 		that.userInfo.avatar = res.data.url;
			// 		// }
			// 		that.switchUserInfo[that.userIndex] = userInfo;
			// 		that.$set(that, 'switchUserInfo', that.switchUserInfo);
			// 		this.canvasStatus = false
			// 	}, (res) => {
			// 		this.canvasStatus = false
			// 	}, (res) => {
			// 		this.canvasWidth = res.w
			// 		this.canvasHeight = res.h
			// 	});
			// },
			// 微信头像获取
			onChooseAvatar(e) {
				const {
					avatarUrl
				} = e.detail
				console.log(avatarUrl)
				this.$util.uploadImgs('upload/image', avatarUrl, (res) => {
					this.userInfo.avatar = res.data.url
				}, (err) => {
					console.log(err)
				})
			},
			/**
			 * 提交修改
			 */
			formSubmit: function(e) {
				let that = this,
					value = e.detail.value;
		
				if (!that.addressInfo.length) return that.$util.Tips({
					title: '请选择所在地区'
				});
				if (that.addressInfo.length < 3) return that.$util.Tips({
					title: '请补全所在地区信息'
				});
				
				if (!value.address_detail) return that.$util.Tips({
					title: '请填写详细地址'
				});
				
				let regionArray = that.addressInfo;
				value.address = {
					province: regionArray[0].label,
					city: regionArray[1].label,
					district: regionArray[2].label,
					street: regionArray[3]?regionArray[3].label:'',
					city_id: regionArray[regionArray.length-1].id?regionArray[regionArray.length-1].id:that.city_id,
				};
				
				// 经度
				value.longitude = that.longitude;
				// 纬度
				value.latitude = that.latitude;
				
				value.spread = that.invitationCode;
				value.role = that.role;
				value.project = that.projectList[that.projectIndex];
				value.house_type = that.houseType[that.houseTypeIndex];
				value.want_to = that.wantTo[that.wantToIndex];
				
				let address_arr = [];
				for (var i = 0; i < that.addressList.length; i++) {
					let item = that.addressList[i];
					address_arr[i] = item.name;
				}
				value.address_arr = address_arr;
				
				console.log('>>>>>>',value)
				
				userEdit(value).then(res => {
					that.$util.Tips({
						title: res.msg,
						icon: 'success'
					});
					setTimeout(() => {
						uni.hideToast();
						//关闭提示后跳转
						uni.switchTab({
							url: '/pages/user/index'
						})
						// uni.navigateBack({
						// 	delta: 1
						// });
					}, 1500)
				}).catch(msg => {
					console.log('>>>>>><<<<<<',msg)
					return that.$util.Tips({
						title: msg || '保存失败，您并没有修改'
					});
				});
			}
		}
	}
</script>
<style lang="scss">
	/deep/uni-checkbox .uni-checkbox-input {
		margin-top: -6rpx;
	}
.popup-content {
  padding: 20px;
  background-color: #fff;
}
.popup-header {
  display: flex;
  justify-content: flex-end;
}
.checkbox-item {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}
.checkbox-item.checked {
  background-color: #f0f8ff; /* 勾选后背景变色 */
}
.checkbox-label {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 0;
}
.checkbox-text {
  margin-left: 10px;
  flex-grow: 1;
  font-size: 16px;
}
.checkbox {
  flex-shrink: 0;
}
	.login-wrapper .list .item .picEwm,
	.login-wrapper .list .item .pictrue {
    border: 1px solid #eee;
		width: 150rpx;
		height: 150rpx;
		border-radius: 3rpx;
		position: relative;
		margin-right: 23rpx;
	}

	.login-wrapper .list .item .picEwm image {
		width: 100%;
		height: 100%;
		border-radius: 3rpx;
	}

	.login-wrapper .list .item .picEwm .icon-guanbi1 {
		position: absolute;
		right: -14rpx;
		top: -16rpx;
		font-size: 40rpx;
	}

	.appLogin {
		margin-top: 60rpx;

		.hds {
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 24rpx;
			color: #B4B4B4;

			.line {
				width: 68rpx;
				height: 1rpx;
				background: #CCCCCC;
			}

			p {
				margin: 0 20rpx;
			}
		}

		.btn-wrapper {
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 30rpx;

			.btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 68rpx;
				height: 68rpx;
				border-radius: 50%;
			}

			.apple-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 246rpx;
				height: 66rpx;
				margin-left: 30rpx;
				background: #EAEAEA;
				border-radius: 34rpx;
				font-size: 24rpx;

				.icon-s-pingguo {
					color: #333;
					margin-right: 10rpx;
					font-size: 34rpx;
				}
			}

			.iconfont {
				font-size: 40rpx;
				color: #fff;
			}

			.wx {
				background-color: #61C64F;
			}

			.mima {
				background-color: #28B3E9;
			}

			.yanzheng {
				background-color: #F89C23;
			}

			.pingguo {
				margin-left: 60rpx;
				background-color: #000;
			}

		}
	}

	.main-color {
		color: var(--view-theme);
	}

	.code img {
		width: 100%;
		height: 100%;
	}

	.acea-row.row-middle {
		input {
			margin-left: 20rpx;
			display: block;
		}
	}

	.login-wrapper {
		padding-bottom: 80rpx;
		.login-top {
			height: 358rpx;
			background-color: var(--view-minorColor);
			background-image: url('../static/login.png');
			background-size: cover;
			background-repeat: no-repeat;

			image {
				width: 101%;
				height: 100%;
			}
		}

		.shading {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
			margin-top: -300rpx;
			position: relative;

			image {
				width: 180rpx;
				height: 180rpx;
				top: 0rpx;
			}
		}

		.whiteBg {
			background-color: #fff;
			margin: -30rpx 40rpx 0rpx 40rpx;
			box-shadow: 0px 2px 14px 0px rgba(0, 0, 0, 0.08);
			border-radius: 8px;
			padding: 20rpx;

			.tips {
				display: flex;
				align-items: center;
				justify-content: center;
				height: 50rpx;
				margin: 40rpx;
				color: #999;

				.tips-btn {
					margin: 0 31rpx 0 48rpx;
					color: #999999;
					font-weight: bold;
					font-size: 32rpx;


					/* Safari 与 Chrome */
					.line {
						width: 80rpx;
						height: 6rpx;
						background: linear-gradient(135deg, var(--view-minorColor) 0%, var(--view-theme) 100%);
						border-radius: 2px;
						margin: 10rpx auto 0 auto;
						animation: myfirst .3s;
						-webkit-animation: myfirst .3s;
					}

					.none {
						width: 80rpx;
						background: #fff;
						height: 6rpx;
					}
				}

				@keyframes myfirst {
					0% {
						width: 0rpx;
					}

					100% {
						width: 80rpx;
					}
				}

				@-webkit-keyframes myfirst

				/* Safari 与 Chrome */
					{
					0% {
						width: 0rpx;
					}

					100% {
						width: 80rpx;
					}
				}

				.tips-btn.on {
					font-size: 36rpx;
					color: var(--view-theme);
				}
			}

			.list {
				border-radius: 16rpx;
				overflow: hidden;

				.forgetPwd {
					text-align: right;
					margin-top: 10rpx;
					color: #666666;
					font-size: 24rpx;
				}

				.item {
					background: #fff;
					border-bottom: 1px solid #F0F0F0;
					.itemImg-add {
					  width: 24rpx;
					   height: 34rpx;
					}
					.item-img {
					  width: 28rpx; 
					  height: 32rpx;
					}
					.InvitationCode{
					  width: 28rpx; 
					  height: 28rpx;
					  &.address{
						  margin-right: 20rpx;
					  }
					}
					.acea-row{
						position: relative;
						padding: 10rpx 20rpx;
						
						input {
							flex: 1;
							font-size: 28rpx;
							height: 80rpx;
						}
						
						.code {
							position: absolute;
							right: 30rpx;
							top: 50%;
							color: var(--view-theme);
							font-size: 26rpx;
							transform: translateY(-50%);
						}
						.uni-list-cell-left{
							color: #999;
							text{
								font-size: 26rpx;
							}
							&.on{
								text{
									font-size: 32rpx;
								}
							}
						}
						.uni-list-cell-db{
							margin-left: 30rpx;
						}
					}
					.input-box {
						display: flex;
						align-items: center;
						flex: 1;
						.icon-yanzhengma {
							font-size: 28rpx;
							color: #ddf8e4;
							font-weight: normal;
							margin-left: 30rpx;
							margin-bottom: 0rpx;
							display: none;
						}
						.isSend {
							color: $kf-theme;
							color: var(--view-theme);
							display: block;
						}
					}
					.addressCon{
						padding: 20rpx;
					}
					&.on{
						padding: 20rpx 0rpx;
					}
				}
				.user-info{
					padding: 30rpx 0;
					text-align: center;
					.user-info-top{
						padding: 30rpx 0;
						.top-image{
							image{
								width: 80rpx;
								height: 80rpx;
								border-radius: 50%;
							}
						}
						.top-nickname{
							margin-left: 20rpx;
							text{
								margin-left: 30rpx;
							}
						}
					}
					.user-info-down{
						text-align: center;
					}
				}
			}
      .InvitationCode{
        img{
          width: 28rpx;
          height: 28rpx;
        }
        width: 28rpx; 
        height: 28rpx;
        &.address{
          margin-right: 20rpx;
        }
      }
			.logon {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 86rpx;
				margin-top: 48rpx;
				background: linear-gradient(135deg, var(--view-minorColor) 0%, var(--view-theme) 100%);
				border-radius: 120rpx;
				color: #FFFFFF;
				font-size: 30rpx;
			}
			
			.register {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 86rpx;
				margin-top: 20rpx;
				border: solid 1rpx var(--view-theme);
				border-radius: 120rpx;
				color: var(--view-minorColor);
				font-size: 30rpx;
			}
		}
    .contract{
      margin-top: 40rpx;
      color: #999999;
      font-size: 24rpx;
    }
		.protocol {
			margin-top: 10rpx;
			color: #999999;
			font-size: 24rpx;
		}

		.trembling {
			animation: shake 0.6s;
		}

		@keyframes shake {

			0%,
			100% {
				-webkit-transform: translateX(0);
			}

			10%,
			30%,
			50%,
			70%,
			90% {
				-webkit-transform: translateX(-5rpx);
			}

			20%,
			40%,
			60%,
			80% {
				-webkit-transform: translateX(5rpx);
			}
		}

		@-o-keyframes shake {

			/* Opera */
			0%,
			100% {
				-webkit-transform: translateX(0);
			}

			10%,
			30%,
			50%,
			70%,
			90% {
				-webkit-transform: translateX(-5rpx);
			}

			20%,
			40%,
			60%,
			80% {
				-webkit-transform: translateX(5rpx);
			}
		}

		@-webkit-keyframes shake {

			/* Safari 和 Chrome */
			0%,
			100% {
				-webkit-transform: translateX(0);
			}

			10%,
			30%,
			50%,
			70%,
			90% {
				-webkit-transform: translateX(-5rpx);
			}

			20%,
			40%,
			60%,
			80% {
				-webkit-transform: translateX(5rpx);
			}
		}

		@-moz-keyframes shake {

			/* Firefox */
			0%,
			100% {
				-moz-transform: translateX(0);
			}

			10%,
			30%,
			50%,
			70%,
			90% {
				-moz-transform: translateX(-5rpx);
			}

			20%,
			40%,
			60%,
			80% {
				-moz-transform: translateX(5rpx);
			}
		}
	}
</style>
<style scoped lang="scss">
	// .personal-data{
	// 	padding-bottom: 50rpx;
	// }
	// .dater{
	// 	width: 400rpx;
	// }
	// .grab{
	// 	color: #ccc !important;
	// }
	// .asterisk{
	// 	color: red;
	// 	font-size: 20rpx;
	// 	margin-left: 6rpx;
	// }
	// .placeholder{
	// 	color: #ccc;
	// }
	// .cartcolor {
	// 	color: var(--view-theme);
	// 	border: 1px solid var(--view-theme);
	// }

	// .personal-data .wrapper {
	// 	margin: 10rpx 0;
	// 	background-color: #fff;
	// 	padding: 36rpx 30rpx 13rpx 30rpx;
	// }

	// .personal-data .wrapper .title {
	// 	margin-bottom: 30rpx;
	// 	font-size: 32rpx;
	// 	color: #282828;
	// }

	// .personal-data .wrapper .wrapList .item {
	// 	width: 690rpx;
	// 	height: 160rpx;
	// 	background-color: #f8f8f8;
	// 	border-radius: 20rpx;
	// 	margin-bottom: 22rpx;
	// 	padding: 0 30rpx;
	// 	position: relative;
	// 	border: 2rpx solid #f8f8f8;
	// 	box-sizing: border-box;
	// }

	// .personal-data .wrapper .wrapList .item.on {
	// 	border-color: #e93323;
	// 	border-radius: 20rpx;
	// 	background-size: 100% 100%;
	// 	background-color: #fff9f9;
	// 	background-repeat: no-repeat;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt {
	// 	width: 445rpx;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt .pictrue {
	// 	width: 96rpx;
	// 	height: 96rpx;
	// 	position: relative;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt .pictrue image {
	// 	width: 100%;
	// 	height: 100%;
	// 	border-radius: 50%;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt .pictrue .alter {
	// 	width: 30rpx;
	// 	height: 30rpx;
	// 	border-radius: 50%;
	// 	position: absolute;
	// 	bottom: 0;
	// 	right: 0;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt .text {
	// 	width: 325rpx;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt .text .name {
	// 	width: 100%;
	// 	font-size: 30rpx;
	// 	color: #282828;
	// }

	// .personal-data .wrapper .wrapList .item .picTxt .text .phone {
	// 	font-size: 24rpx;
	// 	color: #999;
	// 	margin-top: 10rpx;
	// }

	// .personal-data .wrapper .wrapList .item .bnt {
	// 	font-size: 24rpx;
	// 	background-color: #fff;
	// 	border-radius: 27rpx;
	// 	width: 140rpx;
	// 	height: 54rpx;
	// 	border: 2rpx solid #e93323;
	// }

	// .personal-data .wrapper .wrapList .item .currentBnt {
	// 	position: absolute;
	// 	right: 0;
	// 	top: 0;
	// 	font-size: 26rpx;
	// 	background-color: rgba(233, 51, 35, 0.1);
	// 	width: 140rpx;
	// 	height: 48rpx;
	// 	border-radius: 0 20rpx 0 20rpx;
	// }

	// .personal-data .list {
	// 	background-color: #fff;
	// }

	// .personal-data .list .item {
	// 	padding: 30rpx 30rpx 30rpx 0;
	// 	border-bottom: 1rpx solid #f2f2f2;
	// 	margin-left: 30rpx;
	// 	font-size: 32rpx;
	// 	color: #282828;
	// 	.address {
	// 		.addressCon{
	// 			width: 360rpx;
	// 			.tip{
	// 				font-size: 21rpx;
	// 			}
	// 		}
	// 		.fontcolor{
	// 			color: var(--view-theme);
	// 		}
	// 	}
	// 	.label{
	// 		margin-right: 30rpx;
	// 	}
	// 	&:last-child {
	// 		border-bottom: 0rpx solid #f2f2f2;
	// 	}
	// }

	// .personal-data .list .item .phone {
	// 	width: 160rpx;
	// 	height: 56rpx;
	// 	font-size: 24rpx;
	// 	color: #fff;
	// 	line-height: 56rpx;
	// 	border-radius: 32rpx
	// }

	// .personal-data .list .item .pictrue {
	// 	width: 88rpx;
	// 	height: 88rpx;
	// }

	// .personal-data .list .item .pictrue image {
	// 	width: 100%;
	// 	height: 100%;
	// 	border-radius: 50%;
	// }

	// .personal-data .list .item .input {
	// 	width: 460rpx;
	// 	text-align: right;
	// 	color: #868686;
	// 	input{
	// 		text-align: right;
	// 	}
	// 	.picker{
	// 		width: 400rpx;
	// 	}
	// }

	// .personal-data .list .item .input .id {
	// 	width: 414rpx;
	// }

	// .personal-data .list .item .input .iconfont {
	// 	font-size: 35rpx;
	// 	color: #868686;
	// }

	// .personal-data .modifyBnt {
	// 	font-size: 32rpx;
	// 	color: #fff;
	// 	width: 690rpx;
	// 	height: 90rpx;
	// 	border-radius: 50rpx;
	// 	text-align: center;
	// 	line-height: 90rpx;
	// 	margin: 76rpx auto 0 auto;
	// }

	// .personal-data .logOut {
	// 	font-size: 32rpx;
	// 	text-align: center;
	// 	width: 690rpx;
	// 	height: 90rpx;
	// 	border-radius: 45rpx;
	// 	margin: 30rpx auto 0 auto;
	// }

	// .avatar-box {
	// 	width: 96rpx;
	// 	height: 96rpx;

	// 	image {
	// 		width: 100%;
	// 		height: 100%;
	// 		border-radius: 50%;
	// 		border: 1px solid #eee;
	// 	}
	// }
	
	// .listssss {
	// 	overflow: hidden;
	
	// 	.forgetPwd {
	// 		text-align: right;
	// 		margin-top: 10rpx;
	// 		color: #666666;
	// 		font-size: 24rpx;
	// 	}
	
	// 	.item {
	// 		background: #fff;
	// 		border-bottom: 1px solid #F0F0F0;
	// 		.itemImg-add {
	// 		  width: 24rpx;
	// 		   height: 34rpx;
	// 		}
	// 		.item-img {
	// 		  width: 28rpx; 
	// 		  height: 32rpx;
	// 		}
			// .InvitationCode{
			//   width: 28rpx; 
			//   height: 28rpx;
			//   &.address{
			// 	  margin-right: 20rpx;
			//   }
			// }
	// 		.acea-row{
	// 			position: relative;
	// 			padding: 10rpx 20rpx;
				
	// 			input {
	// 				flex: 1;
	// 				font-size: 28rpx;
	// 				height: 80rpx;
	// 			}
				
	// 			.code {
	// 				position: absolute;
	// 				right: 30rpx;
	// 				top: 50%;
	// 				color: var(--view-theme);
	// 				font-size: 26rpx;
	// 				transform: translateY(-50%);
	// 			}
	// 			.uni-list-cell-left{
	// 				color: #999;
	// 				text{
	// 					font-size: 26rpx;
	// 				}
	// 				&.on{
	// 					text{
	// 						font-size: 32rpx;
	// 					}
	// 				}
	// 			}
	// 			.uni-list-cell-db{
 //          flex: 1;
	// 				margin-left: 30rpx;
	// 			}
	// 		}
	// 		.input-box {
	// 			display: flex;
	// 			align-items: center;
	// 			flex: 1;
	// 			.icon-yanzhengma {
	// 				font-size: 28rpx;
	// 				color: #ddf8e4;
	// 				font-weight: normal;
	// 				margin-left: 30rpx;
	// 				margin-bottom: 0rpx;
	// 				display: none;
	// 			}
	// 			.isSend {
	// 				color: $kf-theme;
	// 				color: var(--view-theme);
	// 				display: block;
	// 			}
	// 		}
	// 		.addressCon{
	// 			padding: 20rpx;
	// 		}
	// 		&.on{
	// 			padding: 20rpx 0rpx;
	// 		}
	// 	}
	// 	.user-info{
	// 		padding: 30rpx 0;
	// 		text-align: center;
	// 		.user-info-top{
	// 			padding: 30rpx 0;
	// 			.top-image{
	// 				image{
	// 					width: 80rpx;
	// 					height: 80rpx;
	// 					border-radius: 50%;
	// 				}
	// 			}
	// 			.top-nickname{
	// 				margin-left: 20rpx;
	// 				text{
	// 					margin-left: 30rpx;
	// 				}
	// 			}
	// 		}
	// 		.user-info-down{
	// 			text-align: center;
	// 		}
	// 	}
	// }
</style>
